package cn.itcast.demo01;

import java.io.File;

public class Demo03File {
    public static void main(String[] args) {
        show04();
    }

    private static void show04() {
        File f1 = new File("E:\\Java\\JAVAAPI_CN");
        File f2 = new File("E:\\MyApplication4");
        long length = f2.length();
        System.out.println(length);
    }

    private static void show03() {
        File f1 = new File("E:\\Java\\JAVAAPI_CN");
        File f2 = new File("a.txt");
        String name = f1.getName();
        System.out.println(name);//结尾部分
    }

    private static void show02() {
        File f1 = new File("E:\\Java\\JAVAAPI_CN");
        File f2 = new File("a.txt");
        String f1Path = f1.getPath();
        String f2Path = f2.getPath();
        System.out.println(f1Path.toString());
        System.out.println(f2Path);
    }

    private static void show01() {
        File f1 = new File("E:\\Java\\JAVAAPI_CN");
        String absolutePath1 = f1.getAbsolutePath();
        System.out.println(absolutePath1);

        File f2 = new File("a.txt");
        String absolutePath2 = f2.getAbsolutePath();
        System.out.println(absolutePath2);

    }
}

